home *** CD-ROM | disk | FTP | other *** search
/ Power Hacker 2003 / Power_Hacker_2003.iso / Exploit and vulnerability / w00w00 / sectools / dsniff / decode_nntp.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-16  |  608 b   |  33 lines

  1. /*
  2.   decode_nntp.c
  3.  
  4.   Network News Transport Protocol.
  5.   
  6.   Copyright (c) 2000 Felix von Leitner <felix@convergence.de>
  7.   Copyright (c) 2000 Dug Song <dugsong@monkey.org>
  8.  
  9.   $Id: decode_nntp.c,v 1.1 2000/05/16 17:31:14 dugsong Exp $
  10. */
  11.  
  12. #include <sys/types.h>
  13. #include <stdio.h>
  14. #include <string.h>
  15. #include "decode.h"
  16.  
  17. int
  18. decode_nntp(u_char *buf, int len)
  19. {
  20.     char *p;
  21.     
  22.     Buf[0] = '\0';
  23.     
  24.     for (p = strtok(buf, "\r\n"); p != NULL; p = strtok(NULL, "\r\n")) {
  25.         if (strncasecmp(p, "AUTHINFO ", 9) == 0) {
  26.             strlcat(Buf, p, sizeof(Buf));
  27.             strlcat(Buf, "\n", sizeof(Buf));
  28.         }
  29.     }
  30.     return (strlen(Buf));
  31. }
  32.  
  33.